<ad-cell-container>
  <ng-container *ngFor="let item of cellRenderList">
    <ng-container
      *ngIf="
        auth(handleAttrFunc(item.auth, ['string'])) && handleAttrFunc(item.ngIf, ['boolean'], true)
      "
    >
      <!-- 因为switch无法识别可辨识联合 所里这里使用ngIf -->
      <ng-container *ngIf="item.tag === 'span'">
        <span
          (click)="handleEventFunc(item.click, $event)"
          nz-popover
          [nzPopoverTitle]="handleAttrFunc(item.nzTooltipTitle, ['string'], '')"
          [nzPopoverContent]="handleAttrFunc(item.nzPopoverContent, ['string'], '')"
          [nzPopoverOverlayClassName]="'cell-template-popover-overlay'"
          [ngClass]="handleAttrFunc(item.class, ['array', 'string'], [])"
          [ngStyle]="handleAttrFunc(item.style, ['object'], {})"
          [title]="
            handleAttrFunc(
              item.title,
              ['string'],
              handleAttrFunc(item.value, ['string', 'number'], value)
            )
          "
          >{{ handleAttrFunc(item.value, ['string', 'number'], value) }}</span
        >
      </ng-container>
      <ng-container *ngIf="item.tag === 'nzIcon'">
        <span
          (click)="handleEventFunc(item.click, $event)"
          nz-icon
          nz-popover
          [nzPopoverTitle]="handleAttrFunc(item.nzTooltipTitle, ['string'], '')"
          [nzPopoverContent]="handleAttrFunc(item.nzPopoverContent, ['string'], '')"
          [nzPopoverOverlayClassName]="'cell-template-popover-overlay'"
          [ngClass]="handleAttrFunc(item.class, ['array', 'string'], [])"
          [ngStyle]="handleAttrFunc(item.style, ['object'], {})"
          [title]="
            handleAttrFunc(
              item.title,
              ['string'],
              handleAttrFunc(item.value, ['string', 'number'], value)
            )
          "
          [nzType]="handleAttrFunc(item.nzType, ['string'], '')"
          [nzTheme]="handleAttrFunc(item.nzTheme, ['string'], 'outline')"
          [nzTwotoneColor]="handleAttrFunc(item.nzTwotoneColor, ['string'], '#333')"
          >{{ handleAttrFunc(item.value, ['string', 'number'], value) }}</span
        >
      </ng-container>
      <ng-container *ngIf="item.tag === 'img'">
        <img
          imgError
          (click)="handleEventFunc(item.click, $event)"
          nz-popover
          [nzPopoverTitle]="handleAttrFunc(item.nzTooltipTitle, ['string'], '')"
          [nzPopoverContent]="handleAttrFunc(item.nzPopoverContent, ['string'], '')"
          [nzPopoverOverlayClassName]="'cell-template-popover-overlay'"
          [ngClass]="handleAttrFunc(item.class, ['array', 'string'], [])"
          [ngStyle]="handleAttrFunc(item.style, ['object'], {})"
          [title]="handleAttrFunc(item.title, ['string'])"
          [src]="handleAttrFunc(item.src, ['string'])"
          [alt]="handleAttrFunc(item.alt, ['string'])"
        />
      </ng-container>
      <ng-container *ngIf="item.tag === 'nzSwitch'">
        <nz-switch
          nzCheckedChildren="开"
          nzUnCheckedChildren="关"
          [nzDisabled]="handleAttrFunc(item.disabled, ['boolean'], false)"
          [ngModel]="handleAttrFunc(item.ngModel, ['boolean'])"
          (ngModelChange)="handleEventFunc(item.ngModelChange, $event)"
        ></nz-switch>
      </ng-container>
    </ng-container>
  </ng-container>
</ad-cell-container>
